const router = require('koa-router')()
const homeworkController = require('../controller/homework')

router.post('/api/works/',homeworkController.insertWork)
router.delete('/api/works/',homeworkController.deltWork)
router.get('/api/works/',homeworkController.showAllWork)
// router.get('/api/download/',homeworkController.download)

router.get('/api/name/',async function(){
	ctx.setHeader('Access-Control-Allow-Origin','*');
ctx.setHeader('Access-Control-Allow-Methods',' GET, POST, PUT,DELETE');
   
ctx.setHeader('Access-Control-Allow-Headers',' Origin, X-Requested-With, Content-Type, Accept, Connection, User-Agent, Cookie, eeex ');

	ctx.body={
		name:'乘风',
		age:22
	}
})
module.exports = router
